home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 6: Level 6 / 17 Bit - Level 6 (1998)(Epic Marketing)[!].iso / quartz / q0398.dms / q0398.adf / DonsGenies / Don'sGenies / ResizeGrid.pprx < prev    next >
Text File  |  1992-07-28  |  836b  |  45 lines

  1. /* This Genie resizes the grid while keeping the same proportions.
  2. Written by Don Cox */
  3.  
  4.  
  5. signal on error
  6. signal on syntax
  7. address command
  8. call SafeEndEdit.rexx()
  9. call ppm_AutoUpdate(0)
  10. cr="0a"x
  11.  
  12. currentunits = ppm_GetUnits()
  13. call ppm_SetUnits(2)
  14. gsize = ppm_GetGridSize()
  15. userinput = ppm_GetUserText(7,"Type percentage of current size")
  16. if userinput = "" then exit_msg()
  17. Xsize = word(gsize,1)
  18. Ysize = word(gsize,2)
  19. userinput = userinput/100
  20. Xsize = Xsize*userinput
  21. Ysize = Ysize*userinput
  22. call ppm_SetGridSize(Xsize,Ysize)
  23. call ppm_SetUnits(currentunits)
  24.  
  25. call exit_msg()
  26.  
  27. end
  28.  
  29. error:
  30. syntax:
  31.     do
  32.     exit_msg("Genie failed due to error: "errortext(rc))
  33.     end
  34.  
  35. exit_msg:
  36.     do
  37.     parse arg message
  38.     if message ~= "" then
  39.     call ppm_Inform(1,message)
  40.     call ppm_ClearStatus()
  41.     call ppm_AutoUpdate(1)
  42.     exit
  43.     end
  44.  
  45.